package main

import (
	"fmt"
	"reflect"
)

func testReflect(b interface{}) {
	rVal := reflect.ValueOf(b)
	fmt.Printf("rval的类型为%T\n", rVal)

	iVal := rVal.Interface()
	fmt.Printf("ival的类型为%T\n", iVal)

	//类型断言转换为基本数据类型
	res := iVal.(float32)
	fmt.Printf("res的类型值为%T\n", res)
}
func testReflect02(b interface{}) {

}

type student struct {
	Name string
	Age  int
}

func main() {
	/*var num float32 = 10
	testReflect(num)*/
	stu := student{Name: "tom", Age: 24}
}
